//
// Created by xuzhou4 on 2022/2/9.
//

#ifndef MEDIA_MYGLRENDERCONTEXT_H
#define MEDIA_MYGLRENDERCONTEXT_H


#include "LogUtils.h"
#include <GLES3/gl3.h>
#include "GLSampleBase.h"

class MyGLRenderContext {

    MyGLRenderContext();

    ~MyGLRenderContext();

public:

    static MyGLRenderContext *GetInstance();

    static void DestroyInstance();

    void SetImageData(int format, int width, int height, uint8_t *pData);

    void OnSurfaceCreated();

    void OnSurfaceChanged(int width, int height);

    void OnDrawFrame();

private:

    static MyGLRenderContext *m_pContext;

    int m_ScreenW;

    int m_ScreenH;
};


#endif //MEDIA_MYGLRENDERCONTEXT_H
